package czx.service.impl;

import java.io.Serializable;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import czx.dao.BaseDaoI;
import czx.service.BaseServiceI;
import czx.util.HqlExp;

@Service("baseService")
public class BaseServiceImpl<T> implements BaseServiceI<T> {

	private BaseDaoI<T> baseDao;
	
	public BaseDaoI<T> getBaseDao() {
		return baseDao;
	}

	@Autowired
	public void setBaseDao(BaseDaoI<T> baseDao) {
		this.baseDao = baseDao;
	}

	@Override
	public Serializable save(T t) {
		return baseDao.save(t);
	}

	@Override
	public void update(T t) {
		baseDao.update(t);
	}

	@Override
	public void delete(T t) {
		baseDao.delete(t);
	}

	@Override
	public void saveOrUpdate(T t) {
		baseDao.saveOrUpdate(t);
	}

	@Override
	public T get(HqlExp hqlExp) {
		return baseDao.get(hqlExp);
	}

	@Override
	public List<T> find(HqlExp hqlExp) {
		return baseDao.find(hqlExp);
	}

	@Override
	public Long count(HqlExp hqlExp) {
		return baseDao.count(hqlExp);
	}

}
